package com.sojson.project.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sojson.project.dao.AreaInfoDao;
import com.sojson.project.entity.po.AreaInfo;
import com.sojson.project.service.AreaInfoService;

/**
 * 省市区信息表Service实现类
 * 
 * @author liu
 * @date 2021-04-25
 */
@Service
public class AreaInfoServiceImpl implements AreaInfoService {

    @Resource
    private AreaInfoDao areaInfoDaoImpl;

    /**
     * 单条插入
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int insert(AreaInfo areaInfo) {
        int insert = areaInfoDaoImpl.insert(areaInfo);
        return insert;
    }

    /**
     * 批量插入
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int insertList(AreaInfo areaInfo) {
        int insertList = areaInfoDaoImpl.insertList(areaInfo.getAreaInfos());
        return insertList;
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int deleteByDto(AreaInfo areaInfo) {
        int deleteByDto = areaInfoDaoImpl.deleteByDto(areaInfo);
        return deleteByDto;
    }

    /**
     * 统计全部数量
     * 
     * @return
     */
    @Override
    public int countAll() {
        int countAll = areaInfoDaoImpl.countAll();
        return countAll;
    }

    /**
     * 查询所有
     * 
     * @return
     */
    @Override
    public List<AreaInfo> findAll() {
        List<AreaInfo> findAll = areaInfoDaoImpl.listAll();
        return findAll;
    }

    /**
     * 根据对象统计数量
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int countByDto(AreaInfo areaInfo) {
        int countByDto = areaInfoDaoImpl.countByDto(areaInfo);
        return countByDto;
    }

    /**
     * 根据对象查询
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public List<AreaInfo> findByDto(AreaInfo areaInfo) {
        List<AreaInfo> findByDto = areaInfoDaoImpl.listByDto(areaInfo);
        return findByDto;
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     */
    @Override
    public int deleteById(Integer id) {
        int deleteById = areaInfoDaoImpl.deleteById(id);
        return deleteById;
    }

    /**
     * 通过id列表删除(物理删除)
     * 
     * @param ids
     * @return
     */
    @Override
    public int deleteByIdList(List<Integer> ids) {
        int deleteByIdList = areaInfoDaoImpl.deleteByIdList(ids);
        return deleteByIdList;
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int updateById(AreaInfo areaInfo) {
        int updateById = areaInfoDaoImpl.updateById(areaInfo);
        return updateById;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int updateStaticByIdList(AreaInfo areaInfo) {
        int updateStaticByIdList = areaInfoDaoImpl.updateStaticByIdList(areaInfo);
        return updateStaticByIdList;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int updateChangeByIdList(AreaInfo areaInfo) {
        int updateChangeByIdList = areaInfoDaoImpl.updateChangeByIdList(areaInfo.getAreaInfos());
        return updateChangeByIdList;
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int updatePartialById(AreaInfo areaInfo) {
        int updatePartialById = areaInfoDaoImpl.updatePartialById(areaInfo);
        return updatePartialById;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int updateStaticPartialByIdList(AreaInfo areaInfo) {
        int updateStaticPartialByIdList = areaInfoDaoImpl.updateStaticPartialByIdList(areaInfo);
        return updateStaticPartialByIdList;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public int updateChangePartialByIdList(AreaInfo areaInfo) {
        int updateChangePartialByIdList = areaInfoDaoImpl.updateChangePartialByIdList(areaInfo.getAreaInfos());
        return updateChangePartialByIdList;
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     */
    @Override
    public AreaInfo findById(Integer id) {
        AreaInfo findById = areaInfoDaoImpl.findById(id);
        return findById;
    }

    /**
     * 通过id列表查询
     * 
     * @param ids
     * @return
     */
    @Override
    public List<AreaInfo> findByIdList(List<Integer> ids) {
        List<AreaInfo> findByIdList = areaInfoDaoImpl.findByIdList(ids);
        return findByIdList;
    }

    /**
     * 通过对象查询id列表
     * 
     * @param areaInfo
     * @return
     */
    @Override
    public List<Integer> findIdByDto(AreaInfo areaInfo) {
        List<Integer> findIdByDto = areaInfoDaoImpl.findIdByDto(areaInfo);
        return findIdByDto;
    }

    /**
     * 清空数据(物理清空)
     */
    @Override
    public void clear() {
        areaInfoDaoImpl.clear();
    }

}